const container = document.getElementById('starPattern');

// 上半部分：蓝色星星，奇数递增：1,3,5,7,9
for (let i = 1; i <= 9; i += 2) {
  const p = document.createElement('p');
  p.textContent = '*'.repeat(i);
  p.style.color = 'blue';
  container.appendChild(p);
}

// 下半部分：红色星星，奇数递减：9,7,5,3,1
for (let i = 9; i >= 1; i -= 2) {
  const p = document.createElement('p');
  p.textContent = '*'.repeat(i);
  p.style.color = 'red';
  container.appendChild(p);
}